<template>
  <el-dialog
    title="查看"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-form label-width="80px">
      <el-form-item label="教师id">
        <div>{{ teacher.id }}</div>
      </el-form-item>
      <el-form-item label="性别">
<!--        <div>{{ teacher.gender }}</div>-->
        <template slot-scope="scope">
          <div v-if="teacher.gender === 0">男</div>
          <div v-if="teacher.gender === 1">女</div>
        </template>
      </el-form-item>
      <el-form-item label="用户名">
        <!--      <el-input  placeholder="真实姓名"></el-input>-->
        <div>{{ teacher.username }}</div>
      </el-form-item>
      <el-form-item label="真实姓名">
        <!--      <el-input  placeholder="真实姓名"></el-input>-->
        <div>{{ teacher.realName }}</div>
      </el-form-item>
      <el-form-item label="老师类型">
<!--        <div>{{ teacher.roleId }}</div>-->
        <template slot-scope="scope">
          <div v-if="teacher.roleId === 5">直播老师</div>
          <div v-if="teacher.roleId === 2">课程</div>
        </template>
      </el-form-item>
      <el-form-item label="毕业院校">
        <!--      <el-input  placeholder="毕业院校"></el-input>-->
        <div>{{ teacher.graduateSchool }}</div>
      </el-form-item>
      <el-form-item label="学历">
        <!--      <el-input  placeholder="学历"></el-input>-->
        <div>{{ teacher.eduBg }}</div>
      </el-form-item>
      <el-form-item label="抽成余额">
        <!--      <el-input  placeholder="抽成余额"></el-input>-->
        <div>{{ teacher.commistion }}</div>
      </el-form-item>
      <el-form-item label="个人图片">
        <!--        <el-input placeholder="个人图片的地址"></el-input>-->
        <!--        <div>{{teacher.photos}}</div>-->
        <img style="width: 23%;height: 140px" v-for="item in photos" :src="item"></img>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="visible = false">确定</el-button>

    </span>
  </el-dialog>
</template>

<script>
export default {
  // props:['info'],
  data () {
    return {
      visible: true,
      teacher: {},
      photos: []
    }
  },
  mounted () {

  },
  methods: {
    init (teacher) {
      // console.log(teacher)
      this.visible = true
      this.teacher = teacher
      this.photos = teacher.photos.split(',')
      // console.log(this.photos)
    },

    // 表单提交
  }
}
</script>
